import { ThemeContext } from '../util/useContext';

export default function Button(props) {
    console.log("Button", props)
    return (
        <ThemeContext.Consumer>
            {
                ({theme, toggleTheme}) =>  (
                    <button className={theme} onClick={toggleTheme}>
                        {props.children}
                    </button>
                ) 
            }
        </ThemeContext.Consumer>
    )
}